<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('选择薪资类型')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>

<body class="gray-bg">
<div class="modal inmodal fade" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">选择薪资套类型</h4>
            </div>
            <div class="modal-body">
                <p>
                    <select id="pgid" name='pgid' class="form-control">
                    </select>
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" id="missmodal1" class="btn btn-white" data-dismiss="modal">关闭</button>
                <button type="button" onclick="querySalayCalculationTree()" class="btn btn-primary">确认</button>
            </div>
        </div>
    </div>
</div>

<button type="button" id="modal1"  class="btn btn-primary" data-toggle="modal"
        data-target="#myModal1">选择薪资套
</button>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    $(function () {
        $("#modal1").attr("style","display:none;");
        //开启模态窗口
        getSkypayGroups();
    });

    /**
     * 获取薪资套列表
     */
    function getSkypayGroups() {
        var html = "";
        $.ajax({
            async: false,
            url: ctx + "salaryCalculation/getSkypayGroups",
            data: {},
            type: "post",
            dataType: "json",
            success: function (data) {
                $("#pgid").empty();
                var arry = data;
                for (var i = 0; i < arry.length; i++) {
                    html += "<option value='"
                        + arry[i].id
                        + "'>"
                        + arry[i].title
                        + "</option>";
                }
                $("#pgid").append(html);
                $("#modal1").click();
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {

                alert("错误,请联系管理员,错误信息:" + textStatus);
            }
        });
    }
</script>

</body>
</html>